package com.zqxq.lottery.mapper.sys;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.zqxq.lottery.entity.po.jczq.JczqMatchPO;
import com.zqxq.lottery.entity.vo.jczq.JczqMatchLiveVO;
import com.zqxq.lottery.entity.vo.sys.SysMatchVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author 苦智
 * @date 2018/5/7 13:47
 * @description
 * @ClassName MatchManagementMapper
 */
@Component(value = "matchManagementMapper")
public interface MatchManagementMapper extends BaseMapper<JczqMatchPO>{

    List<Map<String,Object>> queryLeagueList();

    List<SysMatchVO> selectMatchList(@Param("leagueId") Long leagueId,@Param("isHot") Integer isHot,@Param("matchTime") String matchTime,@Param("league") String league);

    List<JczqMatchLiveVO> selectMatchShouldList(Page page, @Param("matchTime") String matchTime);

    @Select("select ifnull(COUNT(id),0) manualCount from jczq_match where date(close_time)>DATE_SUB(CURDATE(),INTERVAL 3 DAY) and type=1 and is_hot=1")
    Integer getManualCount();

    Integer updateMatchHotStatus(@Param("id") Long id,@Param("isHot") Integer isHot);

    List<JczqMatchLiveVO> selectNoResultListList(Page page2, @Param("matchTime") String matchTime);
}
